package com.lagou.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lagou.common.pojo.Goods;
import com.lagou.goods.mapper.GoodsMapper;
import com.lagou.goods.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public Goods queryGoodsById(Integer id) {
        return goodsMapper.selectById(id);
    }

    @Override
    public Integer deleteGoodsById(Integer id) {

        return goodsMapper.deleteById(id);
    }

    @Override
    public Integer updateGoodsById(Goods goods) {

        return goodsMapper.updateById(goods);
    }

    @Override
    public Page<Goods> queryByPage(Page<Goods> page, QueryWrapper<Goods> queryWrapper) {

        return goodsMapper.selectPage(page,queryWrapper);
    }


}
